class ChangeColumnNames < ActiveRecord::Migration
  def self.up
    
    remove_index :gestions, :name=>'FK_gestions_personas'
    rename_column 'gestions', 'alumno', 'persona_id'
    add_index 'gestions', 'persona_id', :name=>'FK_gestions_personas'
    
    remove_index :reunions, :name=>'FK_reunions_personas'
    rename_column 'reunions', 'alumno', 'persona_id'
    add_index 'reunions', 'persona_id', :name=>'FK_reunions_personas'

    remove_index :revisacions, :name=>'FK_revisacions_personas'
    rename_column 'revisacions', 'alumno', 'persona_id'
    add_index 'revisacions', 'persona_id', :name=>'FK_revisacions_personas'
  end

  def self.down
    remove_index :gestions, :name=>'FK_gestions_personas'
    rename_column 'gestions', 'persona_id', 'alumno'
    add_index 'gestions', 'alumno', :name=>'FK_gestions_personas'
    
    remove_index :reunions, :name=>'FK_reunions_personas'
    rename_column 'reunions', 'persona_id', 'alumno'
    add_index 'reunions', 'alumno', :name=>'FK_reunions_personas'
    
    remove_index :revisacions, :name=>'FK_revisacions_personas'
    rename_column 'revisacions', 'persona_id', 'alumno'
    add_index 'revisacions', 'alumno', :name=>'FK_revisacions_personas'
  end
end
